
import 'package:bruno/bruno.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

import 'customer_page/view.dart';
import 'home_page/view.dart';
import 'house_page/view.dart';
import 'me_page/view.dart';
import 'message_page/view.dart';

class IndexState {
  late int selectedIndex;

  late List<BrnBottomTabBarItem> list;

  var titles = ['首页', '房源', '客源', '消息', '我的'];

  var icons = [
    'assets/images/main_index_icon.png',
    'assets/images/main_house_icon.png',
    'assets/images/main_custom_icon.png',
    'assets/images/main_message_icon.png',
    'assets/images/main_me_icon.png',
  ];
  var activeIcons = [
    'assets/images/main_index_select_icon.png',
    'assets/images/main_house_select_icon.png',
    'assets/images/main_custom_select_icon.png',
    'assets/images/main_message_select_icon.png',
    'assets/images/main_me_select_icon.png',
  ];

  late List<Widget> listPages;

  late PageController pageController;

  IndexState() {
    selectedIndex = 0;
    pageController = PageController();
    list = [
      for (int i = 0; i < icons.length; i++)
        BrnBottomTabBarItem(
            title: Text(titles[i]),
            selectedTextStyle: TextStyle(fontSize: 15.sp),
            unSelectedTextStyle: TextStyle(fontSize: 12.sp),
            icon: Image.asset(
              icons[i],
              width: 25,
            ),
            activeIcon: Image.asset(activeIcons[i], width: 25))
    ];

    listPages = [
      HomePage(),
      HousePage(),
       CustomerPage(),
       MessagePage(),
      MePage()
    ];
  }
}
